// credits/components/scan-modal/index.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        scanData: {
            type: Object,
            default: {}
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
    
    },

    /**
     * 组件的方法列表
     */
    methods: {
     
        onSubmit() {
            const {id} = this.data.scanData;
            wx.ajax.post("qrCodeManager.action", {qrcode: id}, true).then((val) => {
                wx.showToast({
                    title: val.result,
                    duration:10000
                  })
               this.closeModal()
              })
        },
        closeModal() {
            this.triggerEvent('close', { refresh: false })
        }
    },
   
})